package com.dq.service.order;

import com.dq.exception.customException.AdminException;
import com.dq.controller.in.orders.ShortageOrderQuery;
import com.dq.controller.in.orders.ShortageOrderSave;
import com.dq.domain.orders.ShortageOrder;
import com.dq.domain.orders.info.OrderInfo;
import com.dq.domain.org.Org;

import java.util.List;

/**
 * @author liuhui
 * @date 2019/11/27 0027 14:11:47
 */
public interface ShortageOrderService {

    List<ShortageOrder> findByWhere(ShortageOrderQuery shortageOrderQuery, Org org)throws AdminException;

    Long countByWhere(ShortageOrderQuery shortageOrderQuery, Org org)throws AdminException;

    /**
     *  缺货单 生成逻辑
     * @param shortageOrderSave
     * @return
     * @throws AdminException
     */
    public ShortageOrder manualSave(ShortageOrderSave shortageOrderSave) throws AdminException;

    /**
     * 添加 缺货单实体 main_info
     * @param
     * @return
     * @throws AdminException
     */
    public ShortageOrder saveMainAndInfo(ShortageOrder shortageOrder, List<OrderInfo> orderInfoList) throws AdminException;

    /**
     * 修改 缺货单
     * @param shortageOrder
     * @return
     * @throws AdminException
     */
    public ShortageOrder update(ShortageOrder shortageOrder) throws AdminException;
}
